public class Main {
    public static void main(String[] args) {

        //饿汉
        EagerSingletonFactory.getInstance().setMyName("孙悟空");
        System.out.println(EagerSingletonFactory.getInstance().shoInfo());

        System.out.println(EagerSingletonFactory.getInstance().getMyName());

        System.out.println(EagerSingletonFactory.getInstance().shoInfo());

        //懒汉
        System.out.println(LazySingletonFactory.getInstance().shoInfo());
        System.out.println(LazySingletonFactory.getInstance().shoInfo());


    }
}